function MyCache(name) {
    var version = '20191231';
    var $name = '$' + name + version;
    this.getSessionStorage = function (key) {
        var value= undefined,
            $myCache =  sessionStorage.getItem($name),
            cache =  $myCache ? JSON.parse(decodeURIComponent($myCache)) : [];
        cache.forEach(function (item) {
            if(item.key === key){
                value = item['value']
            }
        });
        return value;
    };
    this.setSessionStorage = function (key,value) {
        var cache;
        if(sessionStorage.getItem($name)){
            cache = JSON.parse(decodeURIComponent(sessionStorage.getItem($name)));
        }else {
            cache = []
        }

        cache.forEach(function (item,index) {
            if(item.key === key){
                cache.splice(index,1);
            }
        });

        cache.push({
            key:key,
            value:value
        });
        sessionStorage.setItem($name,encodeURIComponent(JSON.stringify(cache)))
    };
    return this
}